#include<bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
	int n, ret = 0;
	cin >> n;
	int a[n + 10];
	a[0] = 1;
	for(int i = 1; i <= n; i ++ ) {
		int x;
		cin >> x;
		a[i] = a[i - 1] % 10 * x % 10;
		a[i] %= 10;
		if(a[i] == 6 ) {
			ret ++ ;
		}
	}
	cout << ret << endl;
	return 0;
}

